package com.fc.controller;

import com.fc.dto.ExportDTO;
import com.fc.result.Result;
import com.fc.utils.MinioUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.v3.oas.annotations.parameters.RequestBody;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.time.LocalDate;

@Api(tags = "通用")
@RestController
@RequestMapping("/common")
@RequiredArgsConstructor
public class CommonController {

    private final MinioUtil minioUtil;

    //清空数据接口
    @ApiOperation("删除图片")
    @GetMapping("/clear/picture")
    public Result<Integer> cleanPicture() {
        int count = minioUtil.deleteDateFoldersBefore(LocalDate.of(2025, 8, 1));
        return Result.success(count);

    }
}
